<?
include("../db.php");
include("auth.php");

$id=$_REQUEST['id'];
$sql="SELECT * FROM dokumenter WHERE ID=$id";
$dokumenter=mysql_query($sql);
$dokumentet=mysql_fetch_assoc($dokumenter);

header ("Content-type: ".$dokumentet['datatype']);
header ("Content-length: ".$dokumentet['str']);
header ("Content-Disposition: attachment; filename=".$dokumentet['filnavn']);
header ("Content-Description: PHP Generated Data"); 
echo $dokumentet['data'];
?>
